package com.chixing.ih.module.programmer.controller;

import com.chixing.ih.json.ResponseData;
import com.chixing.ih.module.programmer.pojo.dto.ProgrammerListDTO;
import com.chixing.ih.module.programmer.service.IProgrammerListService;
import com.chixing.ih.util.PageRequest;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @version 1.0
 * @Author MasterYan
 * @Date 2020/10/7
 * Time: 13:54
 */

@RestController
@RequestMapping("/programmerList")
@Api(tags = "程序员模块列表相关Api")
public class ProgrammerListController {

    @Autowired
    IProgrammerListService programmerListService;



    /**
     * desc:根据条件查看程序员列表接口
     *
     * @return
     */
    @ApiOperation(value = "根据条件查看程序员列表接口", notes = "根据条件查看程序员列表")

    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
    })
    @GetMapping("/listProByCondition")
    public Map<String, Object> listProgrammers(PageRequest pageRequest, @RequestParam("programmerCareer") String programmerCareer, @RequestParam("workPlace") String workPlace, @RequestParam("workWay") Integer workWay, @RequestParam("list") List<Integer> list) {
        List<ProgrammerListDTO> listDTOS = programmerListService.programmerListDTOList(pageRequest, programmerCareer, workPlace, workWay, list);
        PageInfo<ProgrammerListDTO> info = new PageInfo<>(listDTOS);
        return ResponseData.REP_GET_SUCCESS(info);

    }

}
